home *** CD-ROM | disk | FTP | other *** search
/ Aminet 4 / Aminet 4 - November 1994.iso / aminet / dev / misc / sana2_v2.lha / copybuff.doc < prev    next >
Text File  |  1994-02-17  |  5KB  |  158 lines

  1. TABLE OF CONTENTS
  2.  
  3. any_sana2_protocol/CopyFromBuff
  4. any_sana2_protocol/CopyToBuff
  5. any_sana2_protocol/PacketFilter
  6. any_sana2_protocol/CopyFromBuff               any_sana2_protocol/CopyFromBuff
  7.  
  8.    NAME
  9.     CopyFromBuff -- Copy n bytes from an abstract data structure.
  10.  
  11.    SYNOPSIS
  12.     success = CopyFromBuff(to, from, n)
  13.     d0               a0  a1    d0
  14.  
  15.     BOOL CopyToBuff(VOID *, VOID *, ULONG);
  16.  
  17.    FUNCTION
  18.     This function copies 'n' bytes of data in the abstract data structure
  19.     pointed to by 'from' into the contigous memory pointed to by 'to'.
  20.     'to' must contain at least 'n' bytes of usable memory or innocent
  21.     memory will be overwritten.
  22.  
  23.    INPUTS
  24.     to        - pointer to contiguous memory to copy to.
  25.     from        - pointer to abstract structure to copy from.
  26.     n        - number of bytes to copy.
  27.  
  28.    RESULT
  29.     success        - TRUE if operation was successful, else FALSE.
  30.  
  31.    EXAMPLE
  32.  
  33.    NOTES
  34.     This function must be callable from interupts.  In particular, this
  35.     means that this function may not directly or indirectly call any
  36.     system memory functions (since those functions rely on Forbid() to
  37.     protect themselves) and that  you must not compile this function
  38.     with stack checking enabled.  See the RKM:Libraries Exec:Interupts
  39.     chapter for more details on what is legal in a routine called from
  40.     an interupt handler.
  41.  
  42.     'C' programmers should not compile with stack checking (option '-v'
  43.     in SAS) and should geta4() or __saveds.
  44.  
  45.    BUGS
  46.  
  47.    SEE ALSO
  48.  
  49. any_sana2_protocol/CopyToBuff                   any_sana2_protocol/CopyToBuff
  50.  
  51.    NAME
  52.     CopyToBuff -- Copy n bytes to an abstract data structure.
  53.  
  54.    SYNOPSIS
  55.     success = CopyToBuff(to, from, n)
  56.     d0             a0  a1    d0
  57.  
  58.     BOOL CopyToBuff(VOID *, VOID *, ULONG);
  59.  
  60.    FUNCTION
  61.     This function first does any initialization and/or allocation
  62.     required to prepare the abstract data structure pointed at by 'to'
  63.     to be filled with 'n' bytes of data from 'from'.  It then executes
  64.     the copy operation.
  65.  
  66.     If, for example, there is not enough memory available to prepare
  67.     the abstract data structure, the call is failed and FALSE is returned.
  68.  
  69.     The buffer management scheme should be such that any memory needed
  70.     to fulfill CopyToBuff() calls is already allocated from the system
  71.     before the call to CopyToBuff() is made.
  72.  
  73.    INPUTS
  74.     to        - pointer to abstract structure to copy to.
  75.     from        - pointer to contiguous memory to copy from.
  76.     n        - number of bytes to copy.
  77.  
  78.    RESULT
  79.     success        - TRUE if operation was successful, else FALSE.
  80.  
  81.    EXAMPLE
  82.  
  83.    NOTES
  84.     This function must be callable from interupts.  In particular, this
  85.     means that this function may not directly or indirectly call any
  86.     system memory functions (since those functions rely on Forbid() to
  87.     protect themselves) and that you must not compile this function
  88.     with stack checking enabled.  See the RKM:Libraries Exec:Interupts
  89.     chapter for more details on what is legal in a routine called from
  90.     an interupt handler.
  91.  
  92.     'C' programmers should not compile with stack checking (option '-v'
  93.     in SAS) and should geta4() or __saveds.
  94.  
  95.    BUGS
  96.  
  97.    SEE ALSO
  98.  
  99. any_sana2_protocol/PacketFilter               any_sana2_protocol/PacketFilter
  100.  
  101.    NAME
  102.     PacketFilter -- Perform filtering operation on CMD_READ's.
  103.  
  104.    SYNOPSIS
  105.     keep = PacketFilter(hook, ios2, data)
  106.     d0             a0    a2    a1
  107.  
  108.     BOOL PacketFilter(struct Hook *, struct IOSana2Req *, APTR);
  109.  
  110.    FUNCTION
  111.     This function (if supplied by a protocol stack) may be used to
  112.     reject packets before they are copied into a protocol stack's
  113.     internal buffers.
  114.  
  115.     The IOSana2Req structure should be set up to look (almost) exactly
  116.     as it would if it was successfully returned for the current packet.
  117.     Specifically, the fields that should be set up correctly are:
  118.  
  119.     ios2->ios2_DataLength
  120.     ios2->ios2_SrcAddr
  121.     ios2->ios2_DstAddr
  122.  
  123.        The "data" pointer must point to the beginning of the packet data
  124.     that is stored in contiguous memory.  The data should NOT include
  125.     any hardware specific headers (unless of course the CMD_READ
  126.     request wanted RAW packets).
  127.  
  128.    INPUTS
  129.     hook        - pointer to the Hook originally supplied during
  130.               OpenDevice().
  131.     ios2        - The IOSana2Req CMD_READ request that will be used
  132.               (the "object" of the Hook call).
  133.     data        - The packet data (the "message" of the Hook call).
  134.  
  135.    RESULT
  136.     success        - TRUE if the driver should provide the packet to
  137.               the protocol stack, FALSE if the packet should be
  138.               ignored.
  139.  
  140.    EXAMPLE
  141.  
  142.    NOTES
  143.     This function must be callable from interupts.  In particular, this
  144.     means that this function may not directly or indirectly call any
  145.     system memory functions (since those functions rely on Forbid() to
  146.     protect themselves) and that  you must not compile this function
  147.     with stack checking enabled.  See the RKM:Libraries Exec:Interupts
  148.     chapter for more details on what is legal in a routine called from
  149.     an interupt handler.
  150.  
  151.     'C' programmers should not compile with stack checking (option '-v'
  152.     in SAS) and should geta4() or __saveds.
  153.  
  154.    BUGS
  155.  
  156.    SEE ALSO
  157.  
  158.